package com.yuexia.yxim.client.sender;

import com.yuexia.yxim.client.protoBuilder.LoginMsgBuilder;
import com.yuexia.yxim.common.bean.msg.ProtoMsg;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

/**
 * LoginSender
 *
 * @author wjp
 * @date 2020/6/1
 */
@Slf4j
@Service
public class LoginSender extends BaseSender{

    public void sendLoginMsg() {
        if (!isConnected()) {
            log.info("还没有建立连接");
            return;
        }

        log.info("生成登录消息==");
        ProtoMsg.Message message = LoginMsgBuilder.buildLoginMsg(getUser(), getSession());

        super.sendMsg(message);
    }

}
